﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls.Primitives;
using System.Windows;
using System.Windows.Media;
using System.Windows.Controls;
using System.Windows.Threading;
using System.Threading;
using System.Windows.Media.Effects;

namespace CMD_DKT.Utilities
{
    class CMDPopUp
    {
        public Popup cmdPopUp;
        System.Windows.Controls.TextBlock popupText;

        public void showPopup(string texto, ContentControl panel)
        {
            cmdPopUp = new Popup();
            popupText = new System.Windows.Controls.TextBlock();

            // initialize the pop up
            cmdPopUp.PopupAnimation = PopupAnimation.Fade;
            cmdPopUp.Placement = PlacementMode.Mouse;
            cmdPopUp.PlacementTarget =  panel; //spAlta
            cmdPopUp.PlacementRectangle = new Rect(50, 150, 60, 90);
            cmdPopUp.Width = 200;
            cmdPopUp.Height = 60;
           
            popupText.Text = texto;
            popupText.TextAlignment = TextAlignment.Center;
            popupText.Background = Brushes.LightBlue;
            popupText.Foreground = Brushes.Blue;
            popupText.Width = 190;
            popupText.Height = 50;

            Border br = new Border();
            br.BorderBrush = Brushes.Navy;
            br.Background = Brushes.LightBlue; 
            br.BorderThickness = new System.Windows.Thickness(0,0,2,2);

            br.Child = popupText;

            //
            cmdPopUp.StaysOpen = true;
            cmdPopUp.Child = br;//popupText;
            cmdPopUp.IsOpen = true;
        }

        public void HidePopup()
        {
            cmdPopUp.IsOpen = false;
        }



    }//end class
}
